/*
 * @Description: 单位导航包裹组件
 * @Author: Rfan
 * @Date: 2022-02-10 13:40:29
 * @LastEditTime: 2022-11-08 16:24:07
 */

import UFALNav from '@/components/UFALNav';
import { useReportTemplateContext } from '../contexts/ReportTemplateContext';
import NavList from './NavList';
import classNames from 'classnames/bind';
import styles from '../styles/navList.module.scss';

const cx = classNames.bind(styles);
const NavSidebar = () => {
  const { setSelectFond, setSelectAT, setSelectLevel } = useReportTemplateContext();

  const handleNavChange = ({ fondItem, atItem, levelItem }: any) => {
    console.log('nav', { fondItem, atItem, levelItem });
    setSelectFond(fondItem);
    setSelectAT(atItem);
    setSelectLevel(levelItem);
  };

  return (
    <div className={cx('overflow')}>
      <div className={cx('nav-left')}>
        <UFALNav onChange={handleNavChange} />
      </div>
      <div>
        <NavList />
      </div>
    </div>
  );
};

export default NavSidebar;
